#include <QApplication>
#include <QDialog>
#include <QPushButton>
#include <QCheckBox>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <qsizepolicy.h>
#include <qlayout.h>
#include <QLineEdit>

int main(int c, char **v)
{
	QApplication app (c, v);
	
	QDialog d(NULL);
	
	QVBoxLayout *vmainlay=new QVBoxLayout();
	QHBoxLayout *h1lay=new QHBoxLayout();
	QHBoxLayout *h2lay=new QHBoxLayout();
	QHBoxLayout *h3lay=new QHBoxLayout();	
	
	QLabel *label = new QLabel("-----vCard-----", &d);
        label->setAlignment(Qt::AlignCenter);
        vmainlay->addWidget(label);
	
	vmainlay->addItem(h1lay);
	vmainlay->addItem(h2lay);
	vmainlay->addItem(h3lay);
	
	h1lay->addWidget(new QLabel("Surname:", &d));
	h1lay->addItem(new QSpacerItem(20, 20));
	h1lay->addWidget(new QLineEdit(&d));
	h1lay->addItem(new QSpacerItem(20, 20));
	h1lay->addWidget(new QLabel("Name:", &d));
	h1lay->addItem(new QSpacerItem(20, 20));
	h1lay->addWidget(new QLineEdit(&d));
	h1lay->addItem(new QSpacerItem(20, 20));	
	
	h2lay->addWidget(new QLabel("Gender:", &d));
	h2lay->addItem(new QSpacerItem(20, 20));
	h2lay->addWidget(new QCheckBox("F", &d));	
	h2lay->addWidget(new QCheckBox("M", &d));
	h2lay->addItem(new QSpacerItem(20, 20));		
	h2lay->addWidget(new QLabel("BDay:", &d));
	h2lay->addItem(new QSpacerItem(20, 20));
	h2lay->addWidget(new QLineEdit(&d));
	h2lay->addItem(new QSpacerItem(20, 20));
	
	h3lay->addWidget(new QLabel("Email:", &d));
	h3lay->addItem(new QSpacerItem(20, 20));
	h3lay->addWidget(new QLineEdit(&d));
	h3lay->addItem(new QSpacerItem(20, 20));
	h3lay->addWidget(new QLabel("Tel:", &d));
	h3lay->addItem(new QSpacerItem(20, 20));
	h3lay->addWidget(new QLineEdit(&d));
	h3lay->addItem(new QSpacerItem(20, 20));
	
	vmainlay->addWidget(new QPushButton("Ok", &d));	
	
	d.setLayout(vmainlay);
	
	d.show();
	
	return app.exec();
}
